﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;
using DAO;
using System.Data.OleDb;

namespace CuaHangHoa
{
    public partial class frmQuanLyDonDatHang : Form
    {
        public frmQuanLyDonDatHang()
        {
            InitializeComponent();
        }

        private void QuanLyDonDatHang_Load(object sender, EventArgs e)
        {
            LoadDonHang();
           
                for (int i = 0; i <= dgvDonHang.Rows.Count - 1; i++)
                {
                    //if (dgvDonHang[2,i].Value)
                    //{
                    //    dgvDonHang.Rows[i].DefaultCellStyle.BackColor = Color.Red;
                    //}
                }
            
            
        }

        private void LoadDonHang()
        {
            //DataTable dt = new DataTable();

            //OleDbConnection cn = DataProvider.ConnectDB();

            //string str = "Select MaKhachHang,NgayGiao,DiaChiGiao,TrangThai,MaHoaDon from HOADON";
            //OleDbDataAdapter da = new OleDbDataAdapter(str, cn);
            //da.Fill(dt);
            //cn.Close();
            DatHangBUS qldhBUS = new DatHangBUS();
            DataTable dt;
            dt = qldhBUS.layTTHoaDon();
            dgvDonHang.DataSource = dt;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show(DateTime.Now.ToString());
        }
    }
}
